package com.njitzx.fileupload.controller;

import com.njitzx.fileupload.pojo.User;
import com.njitzx.fileupload.service.UserService;
import com.njitzx.fileupload.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    /*
     创建用户
     */
    @PostMapping
    public AjaxResult createUser(@RequestBody User user) {
        userService.createUser(user);
        return AjaxResult.success("用户创建成功");
    }
}
